import request from '@/utils/request.js'

//文章分类列表查询
export const articleCategoryListService = () => {
    /*    const tokenStore =userTokenStore();
        //在pinia中定义的响应式数据，都不需要.value
        return request.get('/category/getAllCategory',{headers:{'Authorization':tokenStore.token}})*/
    return request.get('/category/getAllCategory',)
}

//文章分类添加
export const articleCategoryAddService = (categoryData) => {
    return request.post('/category/addCategory', categoryData)
}

//文章分类修改
export const articleCategoryUpdateService = (categoryData) => {
    return request.put('/category/updateCategory', categoryData)
}
//文章分类删除
export const articleCategoryDeleteService = (id) => {
    return request.delete('/category/deleteCategory?id=' + id)
}
//文章列表查询
export const articleListService = (params) => {
    return request.get('/article/getArticle', {params: params})
}

export const articleAddService = (articleData) => {
    return request.post('/article/addArticle', articleData)
}